/*
 * @Descripttion: 熊大写的
 * @version: 1.0.0
 * @Author: xt_xiong
 * @Date: 2022-01-18 15:28:08
 * @LastEditors: xt_xiong
 * @LastEditTime: 2022-01-18 15:39:24
 */
const path = require('path')
module.exports = {
  lintOnSave: false,
  devServer: {
    /*    host: '192.168.91.245', */
    port: 3000,
    open: true,
    overlay: {
      warnings: false,
      errors: true
    }
  },
  chainWebpack: (config) => {
    const svgRule = config.module.rule('svg')
    svgRule.uses.clear()
    svgRule
      .test(/.svg$/)
      .include.add(path.resolve(__dirname, './src/icons/svg'))
      .end()
      .use('svg-sprite-loader')
      .loader('svg-sprite-loader')
      .options({
        symbolId: 'icon-[name]'
      })
    const fileRule = config.module.rule('file')
    fileRule.uses.clear()
    fileRule
      .test(/.svg$/)
      .exclude.add(path.resolve(__dirname, './src/icons/svg'))
      .end()
      .use('file-loader')
      .loader('file-loader')
  }
}
